<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181019_085438_ALERT_DB_PRODUCT
 */
class m181019_085438_ALERT_DB_PRODUCT extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $this->alterColumn('{{product}}', 'customer_id', Schema::TYPE_INTEGER. "(11)  NOT NULL  DEFAULT '0' COMMENT '客户ID' ");

        $this->alterColumn('{{product}}', 'name', Schema::TYPE_STRING. "(255)  NULL   COMMENT '团名称' ");

        $this->alterColumn('{{product}}', 'code', Schema::TYPE_STRING. "(255)  NULL  COMMENT '团号' ");
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181019_085438_ALERT_DB_PRODUCT cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181019_085438_ALERT_DB_PRODUCT cannot be reverted.\n";

        return false;
    }
    */
}
